home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-17 / pcwritex.zip / PCWSTY.TEX (.txt) < prev    next >
LaTeX Document  |  1989-01-03  |  7KB  |  155 lines

  1. % PCWSTY.TEX - This is the file of definitions to handle the PR.DOC output
  2. %              which converts a file from PC-WRITE format to TeX format.
  3. \magnification=\magstep1
  4. %\hsize=6truein \hoffset=.5truein % use this line for theses to give 1
  5. " margin
  6. % sans-serif fonts invoked by Alt-E (elite typesize, originally 12cpi)
  7. \font\zrm=cmss10 
  8. \font\zit=cmssi10
  9. \font\zbf=cmssbx10
  10. \font\zsc=cmss8
  11. % small cmr fonts invoked by Alt-C (originally compressed type)
  12. \font\srm=cmr8
  13. \font\sbf=cmbx8
  14. \font\sit=cmti8
  15. \font\ssl=cmsl8
  16. \font\stt=cmtt8
  17. \font\ssc=cmr6
  18. % use the narrower bold for default bold (Alt-B)
  19. \font\bf=cmb10
  20. % and bold extended for Alt-S (originally shadow-print)
  21. \font\bx=cmbx10
  22. % 17pt fonts for the Alt-D (double-width type) command
  23. \font\brm=cmr17
  24. \font\bit=cmti10 scaled \magstep2
  25. \font\bsl=cmsl10 scaled \magstep2
  26. \font\bbf=cmbx10 scaled \magstep2
  27. \font\btt=cmtt10 scaled \magstep2
  28. \font\bsc=cmcsc10 scaled \magstep2
  29. % cmu gives us the upright pounds sterling sign 
  30. \font\upr=cmu10
  31. % caps and small caps invoked by Alt-P 
  32. \font\sc=cmcsc10
  33. % also grab bold italics
  34. %\font\ibf=cmbxti10 scaled \magstep1
  35. %\font\slbf=cmbxsl10 scaled \magstep1
  36. %\font\cu=cuplt60 at 60truept
  37. % define the three typestyle changes
  38. \def\sans{\let\rm=\zrm\let\it=\zit\let\bf=\zbf\let\sl=\zit\let\bx=\zbf
  39.           \let\sc=\zsc\rm}
  40. \def\smaller{\let\rm=\srm\let\it=\sit\let\bf=\sbf\let\sl=\ssl\let\bx=\sbf
  41.              \let\sc=\ssc\let\tt=\stt\rm\baselineskip=9pt}
  42. \def\bigger{\let\rm=\brm\let\it=\bit\let\bf=\bbf\let\sl=\bsl\let\tt=\btt
  43.             \let\sc=\bsc\let\bx=\bbf\let\stt=\tt\rm}
  44. %\def\bold{\let\rm=\bf\let\bf=\bx\let\it=\ibf\let\sl=\slbf\let\sc=\sbf\rm}
  45. %\def\temp{}
  46. %\def\ital{\let\temp=\rm\let\rm=\it\let\it=\temp\let\bf=\ibf\let\sl=\slbf
  47. %          \let\sc=\ssl\let\bx=\ibf\rm}
  48. % redefine vertical bar character to active and equate it with a prime mark
  49. % for use as abbreviation for feet (or twice for inches)
  50. \catcode`\|=13 
  51. \def|{\ifmmode\vert\else\ifnum\uflag=1 \char'174 \else$'$\fi\fi} 
  52. % redefine slash to active so it can be used in math mode for \over
  53. \catcode`\/=13
  54. \def/{\ifmmode\over\else\char'057 \fi}
  55. % make backslash and otErs produce the right thing in typewriter type
  56. \newcount\fflag \fflag=0
  57. \def\\{\ifnum\fam=\ttfam\char'134 \else\ifnum\fflag=1 \char'134 
  58. \else$\backslash$\fi\fi}
  59. \def\lb{\ifnum\fam=\ttfam\char'173 \else\ifnum\uflag=1 \char'173 
  60. \else\ifmmode\bgroup\else$\{$\fi\fi\fi}
  61. \def\rb{\ifnum\fam=\ttfam\char'175 \else\ifnum\uflag=1 \char'175
  62. \else\ifmmode\egroup\else$\}$\fi\fi\fi}
  63. \def\lt{\ifnum\fam=\ttfam\char'074 \else\ifnum\uflag=1 \char'074 
  64. \else\ifmmode<\else$\langle$\fi\fi\fi}
  65. \def\gt{\ifnum\fam=\ttfam\char'076 \else\ifnum\uflag=1 \char'076 
  66. \else\ifmmode>\else$\rangle$\fi\fi\fi}
  67. \def\tilde{\ifnum\fam=\ttfam\char'176 \else\ifnum\uflag=1 \char'176 
  68. \else$\sim$\fi\fi}
  69. % similarly with caret, but take account of superscripting work
  70. \def\caret{\ifnum\fam=\ttfam{\char'136}%
  71. \else\ifnum\uflag=1 \char'136%
  72. \else\ifmmode^\else{$\wedge$}\fi\fi\fi}
  73. % get math characters to work right in and out of math mode
  74. \def\mt#1{\ifmmode#1\else$#1$\fi}
  75. % ditto sub- and super-scripts
  76. \def\sup#1{\ifmmode{^{\rm #1}}\else$\rm^{#1}$\fi}
  77. \def\sub#1{\ifmmode{_{\rm #1}}\else$\rm_{#1}$\fi}
  78. % define a verbatim mode
  79. \newcount\uflag \uflag=0
  80. \def\verbon{\medbreak\begingroup\stt\baselineskip=9pt\parskip=0pt plus.1pt
  81. \global\uflag=1 \global\fflag=1 \obeylines\obeyspaces}
  82. {\obeyspaces\global\let =\ }
  83. \def\verboff{\endgroup\global\uflag=0 }
  84. % define neater itemisation
  85. \def\element#1 {\item{#1}}
  86. % define pounds sterling sign, cents, yen
  87. \def\pounds{{\upr\$}}
  88. \def\cents{\hbox{\rm\rlap/c}} 
  89. \def\yen{\hbox{\rm\rlap{Y}{$-$}}}
  90. % define double-quote char as active and make it toggle between left and right
  91. % (opening and closing quotes). Can't do this with single-quote because it
  92. % also gets used as an apostrophe which would upset the counter logic. Maybe
  93. % someone could work out a way of testing if the character preceding a single
  94. % quote was a space or line-end, then you could say if so, make it an opening
  95. % single quote. Check also made for if you are in typewriter type, if so, use
  96. % plain double-quote character and try to do the same in underlined mode,
  97. % which is a math box, family -1, which failed before.
  98. \catcode`\"=13 \newcount\quotes
  99. \def"{\ifnum\fam=\ttfam\char'042 \else
  100.       \ifnum\uflag=1 \char'042 \else
  101. %      \ifnum\fam<0 \char'042 \else
  102.       \global\advance\quotes by1 \ifodd\quotes``\else''\fi\fi\fi}
  103. % tidy up footnoting, using the normal \footnote macro but doing automatic
  104. % numbering
  105. \newcount\footnum
  106. \setbox\strutbox=\hbox{\vrule height10pt depth4pt width0pt}% for tabulations
  107. \def\footstrut{\vbox to 9pt{}}
  108. \newbox\fstrutbox
  109. \setbox\fstrutbox=\hbox{\vrule height1pt depth 1pt width0pt}
  110. \def\fstrut{\relax\ifmmode\copy\fstrutbox\else\unhcopy\fstrutbox\fi}
  111. \begingroup\catcode`\@=11
  112. \global\def\@foot{\fstrut\egroup}
  113. \global\def\vfootnote#1{\insert\footins\bgroup%
  114. \interlinepenalty\interfootnotelinepenalty%
  115. \splittopskip\ht\strutbox%topbaseline for broken footnotes%
  116. \splitmaxdepth\dp\strutbox\floatingpenalty\@MM%
  117. \leftskip\z@skip\rightskip\z@skip\spaceskip\z@skip\xspaceskip\z@skip%
  118. \baselineskip=9pt\item{#1}\footstrut\futurelet\next\fo@t}
  119. \endgroup
  120. \def\fn#1{\global\advance\footnum by1 \footnote{$^{\number\footnum}$}
  121. {\global\fflag=1 {\smaller #1}}\global\fflag=0 }
  122. % fudge \narrower to apply to one paragraph only
  123. \def\squeeze{\par\noindent\ignorespaces\let\endgraf=\par%
  124. \edef\restorehsize{\leftskip=0pt\rightskip=\leftskip}%
  125. \def\par{\endgraf\restorehsize\noindent\ignorespaces\let\par=\endgraf}%
  126. \leftskip=2\parindent\rightskip=\leftskip}
  127. % define fractions (TeXbook, p311)
  128. \def\frac#1/#2 {\leavevmode\kern.1em
  129.  \raise.6ex\hbox{\the\scriptfont0 #1}\kern-.1em
  130.  /\kern-.2em\lower.2ex\hbox{\the\scriptfont0 #2}}
  131. % define the fixed-space character
  132. \def\fixspace{{\tt\char'040}}
  133. % ensure baselines are 12pt apart to begin with
  134. \baselineskip=12pt \parskip=.5em plus.25em minus.25em
  135. \tolerance=5000
  136. % Fudge a \la for the beginning of \latex
  137. \def\La{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em}}
  138. \def\insertplot:#1,#2,#3!{\par\hbox{\hskip#3 
  139. \vbox to#2 {\special{hp: plotfile #1 }\vfil}}}
  140. \def\wider{\global\parindent=1in}
  141. \def\normal{\global\parindent=20pt}
  142. \def\tighter{\global\divide\parskip by2}
  143. \def\looser{\global\multiply\parskip by2}
  144. \def\front{\global\pageno=0}
  145. \def\folio{\ifnum\pageno=0 \else\ifnum\pageno<0 \romannumeral-\pageno
  146.     \else\number\pageno\fi\fi}
  147. \def\emgap{\vskip1em\noindent\ignorespaces}%
  148. \def\newpage{\vfill\eject\noindent\ignorespaces}%
  149. \def\newline{\par\vskip-\parskip\noindent\ignorespaces}
  150. \def\csc#1{{\sc\lowercase{#1}}}
  151. \def\uline#1{$\underline{\global\uflag=1\hbox{#1}\global\uflag=0}$} 
  152. \def\newpara{\par\noindent\ignorespaces}%
  153. \message{PC-WRITeX v2.3}
  154. \hbox{}
  155.